find_package(CURL)

if(NOT CURL_FOUND)
  message(WARNING "Skipping http client/server example build: CURL not found")
else()
  include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include
                      ${CMAKE_SOURCE_DIR}/ext/include ${CMAKE_SOURCE_DIR/})

  add_executable(http_client client.cc)
  add_executable(http_server server.cc)

  target_link_libraries(
    http_client ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace http_client_curl
    opentelemetry_exporter_ostream_span ${CURL_LIBRARIES})

  target_link_libraries(
    http_server ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace http_client_curl
    opentelemetry_exporter_ostream_span)
endif()
